import { lazy } from 'react'
// 一级路由
const Home=lazy( ()=>import( '../page/home/home'))
const Detail=lazy( ()=>import( '../page/detail/detail'))
const Long=lazy( ()=>import( '../page/long/long'))
// const Home =lazy(()=>import('../page/home/home'))
// 二级路由
const Ind=lazy (()=>import( '../page/home/ind/ind'))
const My =lazy (()=>import('../page/home/my/my'))


const tolist = [
    {
        path: '/home/ind',
        name: '首页',
        element: <Ind />,
    },
    {
        path: '/home/my',
        name: '我的',
        element: <My />,
    },
]
const routes = [
    {
        path: '/home',
        name: '首页',
        element: <Home />,
        children: tolist
    },
    {
        path: '/detail',
        name: '详情页',
        element: <Detail />
    },
    {
        path: '/long',
        name: '登录',
        element: <Long />
    },
    {
        from: '/',
        to: '/home/my'
    },
]

export {
    routes,
    tolist
}